package com.hahaduo.bee.web.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hahaduo.bee.dao.entity.User;
import com.hahaduo.bee.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {

	/**
	 * VIEW PATH
	 */
	private static final String PATH_PREFIX = "user/";

	@Resource
	private UserService userService;

	@RequestMapping(method = RequestMethod.GET)
	public String list(Map<String, Object> model) {
		
		List<User> listUsers = userService.list();
		model.put("userList", listUsers);
		return PATH_PREFIX + "list";
	}
}